package com.example.user.model.vo;

import com.example.common.validator.Insert;
import com.example.common.validator.Update;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

import java.io.Serializable;

@Data
@EqualsAndHashCode()
@ToString
public class AddressVO implements Serializable {

    @NotNull(groups = {Update.class}, message = "主键不能为空")
    private Long id;

    @NotNull(groups = {Insert.class}, message = "用户ID不能为空")
    private Long userId;

    private String name;

    @NotBlank(groups = {Insert.class}, message = "手机号不能为空")
    @Pattern(groups = {Insert.class, Update.class}, regexp = "^1\\d{10}$",message = "手机号格式不正确")
    private String mobile;

    private String province;

    private String city;

    private String area;

    private String address;

    private int status;

    private int defaultStatus;

}
